/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "BROADCAST_PRODUCTION", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BroadcastProduction.findAll", query = "SELECT b FROM BroadcastProduction b"),
    @NamedQuery(name = "BroadcastProduction.findById", query = "SELECT b FROM BroadcastProduction b WHERE b.id = :id"),
    @NamedQuery(name = "BroadcastProduction.findByUsername", query = "SELECT b FROM BroadcastProduction b WHERE b.username = :username"),
    @NamedQuery(name = "BroadcastProduction.findBySyntax", query = "SELECT b FROM BroadcastProduction b WHERE b.syntax = :syntax"),
    @NamedQuery(name = "BroadcastProduction.findByProvider", query = "SELECT b FROM BroadcastProduction b WHERE b.provider = :provider"),
    @NamedQuery(name = "BroadcastProduction.findByProduction", query = "SELECT b FROM BroadcastProduction b WHERE b.production = :production"),
    @NamedQuery(name = "BroadcastProduction.findByBroadcast", query = "SELECT b FROM BroadcastProduction b WHERE b.broadcast = :broadcast"),
    @NamedQuery(name = "BroadcastProduction.findByStartTime", query = "SELECT b FROM BroadcastProduction b WHERE b.startTime = :startTime"),
    @NamedQuery(name = "BroadcastProduction.findByEndTime", query = "SELECT b FROM BroadcastProduction b WHERE b.endTime = :endTime"),
    @NamedQuery(name = "BroadcastProduction.findByTime", query = "SELECT b FROM BroadcastProduction b WHERE b.startTime <= :startTime AND b.endTime >= :endTime ORDER BY b.provider, b.username, b.syntax"),
    @NamedQuery(name = "BroadcastProduction.findByUnparsableSms", query = "SELECT b FROM BroadcastProduction b WHERE b.unparsableSms = :unparsableSms"),
    @NamedQuery(name = "BroadcastProduction.findByUpdatedTime", query = "SELECT b FROM BroadcastProduction b WHERE b.updatedTime = :updatedTime")})
public class BroadcastProduction implements Serializable {

    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 20)
    @Column(name = "USER_NAME ")
    private String username;
    @Size(max = 20)
    @Column(name = "SYNTAX")
    private String syntax;
    @Size(max = 20)
    @Column(name = "PROVIDER")
    private String provider;
    @Column(name = "PRODUCTION")
    private BigInteger production;
    @Column(name = "BROADCAST")
    private BigInteger broadcast;
    @Column(name = "START_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date startTime;
    @Column(name = "END_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date endTime;
    @Column(name = "UPDATED_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedTime;
    @Size(max = 500)
    @Column(name = "UNPARSABLE_SMS")
    private String unparsableSms;

    public BroadcastProduction() {
    }

    public BroadcastProduction(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getSyntax() {
        return syntax;
    }

    public void setSyntax(String syntax) {
        this.syntax = syntax;
    }

    public String getProvider() {
        return provider;
    }

    public void setProvider(String provider) {
        this.provider = provider;
    }

    public BigInteger getProduction() {
        return production;
    }

    public void setProduction(BigInteger production) {
        this.production = production;
    }

    public BigInteger getBroadcast() {
        return broadcast;
    }

    public void setBroadcast(BigInteger broadcast) {
        this.broadcast = broadcast;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getUnparsableSms() {
        return unparsableSms;
    }

    public void setUnparsableSms(String unparsableSms) {
        this.unparsableSms = unparsableSms;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BroadcastProduction)) {
            return false;
        }
        BroadcastProduction other = (BroadcastProduction) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.BroadcastProduction[ id=" + id + " ]";
    }
}
